package com.project.class4_8.proxy1.service.impl;

import com.project.class4_8.proxy1.dao.IRoomDao;
import com.project.class4_8.proxy1.dao.IUserDao;
import com.project.class4_8.proxy1.service.IUserService;
import com.project.class4_8.proxy1.util.Auto;
import com.project.class4_8.proxy1.util.ServiceProxy;

public class UserServiceImpl implements IUserService {
    @Auto
    private IUserDao userDao;
    @Auto
    private IRoomDao roomDao;
    @Override
    public void add() {
        userDao.add();
        System.out.println(roomDao.findInfo());
    }

    public static void main(String[] args) {
        ServiceProxy proxy = new ServiceProxy(new UserServiceImpl()) ;
        IUserService service = (IUserService) proxy.getProxy();
        service.add();
    }
}
